summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am/lock_accessor.h
blob: 626f60e07983c554a5ccbb80e60e1138e420b2c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include "core/hle/service/kernel_helpers.h"
#include "core/hle/service/service.h"

namespace Service::AM {

class ILockAccessor final : public ServiceFramework<ILockAccessor> {
public:
    explicit ILockAccessor(Core::System& system_);
    ~ILockAccessor() override;

private:
    void TryLock(HLERequestContext& ctx);
    void Unlock(HLERequestContext& ctx);
    void GetEvent(HLERequestContext& ctx);
    void IsLocked(HLERequestContext& ctx);

    bool is_locked{};

    Kernel::KEvent* lock_event;
    KernelHelpers::ServiceContext service_context;
};

} // namespace Service::AM